package com.manager.common.constant;

import com.manager.model.FirstPageState;

public enum MimicryTcpFileType {
    /***
     * Type:1:日志、2:http、3:tcp、4:特征、5:异常行为流量、6:状态统计信息（json key value对方式）;
     * */

    LOG(1,"日志","log",Object.class),

    HTTP(2,"http","http",Object.class),

    TCP(3,"tcp","tcp",Object.class),

    CHARACTERISTIC(4,"特征","characteristics",Object.class),

    EXCEPTION_TRAFFIC(5,"异常行为流量","exception_traffic",Object.class),

    STATE_COUNT(6,"状态统计信息","state_count", FirstPageState.class);

    private int code;

    private String cnDesc;

    private String enDesc;

    private Class<?> claz;

     MimicryTcpFileType(int code, String cnDesc,String enDesc,Class<?> claz) {
        this.code = code;
        this.cnDesc = cnDesc;
        this.enDesc = enDesc;
        this.claz = claz;
    }

    public static MimicryTcpFileType getMimicryTcpFileType(int code) {
         MimicryTcpFileType[]  mimicryTcpFileTypes = MimicryTcpFileType.values();
         for (MimicryTcpFileType mimicryTcpFileType:mimicryTcpFileTypes) {
             if(code == mimicryTcpFileType.getCode()){
                 return mimicryTcpFileType;
             }
         }
         return null;
    }

    public int getCode() {
         return code;
    }

    public String getEnDesc() {
        return enDesc;
    }

    public String getCnDesc() {
        return cnDesc;
    }

    public Class<?> getClaz() {
        return claz;
    }
}
